﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace _10_ExtractTextFromXML
{
    class ExtractFromXML
    {
        static void Main(string[] args)
        {
            StreamReader inputReader = new StreamReader("testXML.xml");
            using (inputReader)
            {
                string inputText = inputReader.ReadToEnd();
                StringBuilder outputText = new StringBuilder();
                bool inTag = false;
                foreach (char symbol in inputText)
                {
                    if (symbol == '<')
                    {
                        inTag = true;
                    }
                    if (symbol == '>')
                    {                        
                        inTag = false;
                        continue;
                    }
                    if (inTag == false)
                    {
                        outputText.Append(symbol);
                    }
                }
                Console.WriteLine(outputText.ToString());
            }
        }
    }
}
